﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;

namespace WCF_AutoUpdates_Services.WCFService
{
    [ServiceContract]
    public interface IAutoUpdate
    {

        /// <summary>
        /// 获取项目版本信息
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <param name="Version">版本号</param>
        /// <param name="VerData">版本发布时间</param>
        /// <returns></returns>
        [OperationContract]
        bool GetProjectVersion(string ProjectName, out string Version, out string VerDate);

        /// <summary>
        /// 获取服务器项目名称列表
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string[] GetPrjNames();

        /// <summary>
        /// 获取服务器项目绝对路径
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <returns></returns>
        [OperationContract]
        string GetProjectPath(string ProjectName);

        /// <summary>
        /// 获取服务器项目文件列表
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <returns></returns>
        [OperationContract]
        FileDataInfo[] GetFileQuantity(string ProjectName);

        /// <summary>
        /// 下载更新项目文件
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <param name="DataInfo">数据文件对象</param>
        /// <returns></returns>
        [OperationContract]
        FileDataInfo DownLoadFile(string ProjectName, FileDataInfo DataInfo);

        /// <summary>
        /// 设施服务器项目版本
        /// </summary>
        /// <param name="Version">版本号</param>
        /// <param name="VerDate">版本发布时间</param>
        /// <param name="PrjName">项目名称</param>
        /// <param name="Password">操作密码</param>
        /// <returns></returns>
        [OperationContract]
        bool SetProjectVersion(string Version, string VerDate, string PrjName, string Password);
        /// <summary>
        /// 删除项目
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <param name="PasswordString">操作密码</param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteProject(string ProjectName, string PasswordString);

        /// <summary>
        /// 设置服务器项目的名称和路径
        /// </summary>
        /// <param name="ProjectName">项目名称</param>
        /// <param name="ProjectDir">项目路径（相对）</param>
        /// <param name="PasswordString">密码</param>
        /// <returns></returns>
        [OperationContract]
        bool SetProject(string ProjectName, string ProjectDir, string PasswordString);

        /// <summary>
        /// 项目文件夹清理
        /// </summary>
        /// <param name="PrjName">项目名称</param>
        /// <returns></returns>
        [OperationContract]
        bool ProjectFolderClear(string PrjName);

        /// <summary>
        /// 项目文件上传
        /// </summary>
        /// <param name="PrjName">项目名称</param>
        /// <param name="DataInfo">文件数据对象</param>
        /// <param name="Password">操作密码</param>
        /// <returns></returns>
        [OperationContract]
        FileDataInfo UpdateFile(string PrjName, FileDataInfo DataInfo, string Password);
    }
}
